package com.bawei.module_mine.ui.mine
import com.bawei.lib_common.appContext
import com.bawei.lib_common.base.BaseViewModel
import com.bawei.lib_common.utils.ToastUtils
import com.bawei.module_mine.model.UserInfoModel
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import javax.inject.Inject

/**
 *作者：lxy
 *功能:
 *时间：2025/5/28
 */
@HiltViewModel
class MineViewModel @Inject constructor(private val mRepository: MineRepository) : BaseViewModel() {

    private val _minePageDataState = MutableStateFlow<UserInfoModel?>(null)
    val mMinePageDataState = _minePageDataState.asStateFlow()

    //个人中心页面数据
    fun getUserInfo() {
        execute(action = mRepository.getUserInfo(), onFinish = {
            if (it.data != null) {
                //保存用户信息
                it.data?.apply {

                }
                _minePageDataState.value = it.data
            }
        }, onError = {
            ToastUtils.showShort(appContext, it)
        })
    }
}

fun test(){
    /**
     *  a
     *  aa
     *  a
     *  a
     *  a
     *  a
     *  a
     *  a
     *  a
     *  a
     *  asd
     *  sfas
     *  adsas
     *  ada
     *  asasz
     *  sadasd
     *  azsdxasd
     *  xcsadca
     *  adssc
     *  adxzc
     *  ad
     *  asdas
     *  sadasdc
     *  sazcx cxfcccc
     *  saxzzzzvsdx
     *  sedzx
     *  sedxz
     *  awszx
     *  awssss
     *  xsax
     *  was
     *  casd
     *  sad
     *  asf
     *  aDSESWF
     *  WERWERFS
     *  DFWE
     *  WEDEWDDER
     *  DTRTERE
     *  ERTE4
     *  E4RTERTERT
     *  DTETERR
     *  DSFDFG
     *  ergdf
     *  ederewfew
     *  ewfsefwse
     *  sfdgresfdv
     *  dasdjfnwse
     *  wyuionb
     *  sdmfhygyuiop
     *  djshjgfcvbjkloiuyf
     *  sdcfytui
     *  njhb
     *  asad
     *  asd
     *  asdc
     *  zcxz
     *  cxdsxc
     *  sazxc
     *  xszx
     *  aszxc
     *  aszxc
     *  sddoij
     *  yuews
     *  asdtcgb
     *  asaud
     *  dslllssdf
     *  是啥晚上
     *  说过的话
     *  时代云
     *  速度预计
     *  鼠标
     *  收到
     *  啥都与
     *  wojd去考试
     *  sadfes
     *  大神版
     *  sdeihn
     *  我的维
     *  围绕
     *  发热tdsf
     *  肉肉古城
     *  sdddf
     *  ad
     *  asfsd
     *  asdf
     *  asdf
     *  sdf
     *  sdfvsdf
     *  sdfv
     *  sdf
     *  sdfv
     *  sdfv
     *  sdfv
     *  sdv
     *  sdf
     *  asfv
     *  sdv
     *  sdsadvc
     *  dertgf
     *  weddrfg
     *  wesdrfgg
     *  wdefrgf
     *  wedfggbfb
     *  wsdefdcvbgfhtyu7trew
     *  wqefrgtffgghytr
     *  qwsedwfrdgf
     *  wsedfrgdgf
     *  wsedrfdgfb
     *  wsedfc
     *  dfvgb
     *  dfgrfg
     *  wedfd
     *  wsedr45tttyhg
     *  ewedfrghytre4rwew
     *  efrddsfedr
     *  fsawedfgbgf
     *  dgbtrrrrhgf
     *  qwsefdf
     *  sdfg
     *
     */
    var a:Int = 5
    var b:Int = 6
    var isShow:Boolean = true
    if (isShow){
        println(a+b)
        println(a)
        println(b)
        isShow = false
        println(isShow)
    }else{
        a = 10
        b=100
        println(a+b)
        a=9
        b=8
        println(b-a)
    }

    var s = "dsd"
    var sk = 8
    var eee = 89
    var dds  = true
    if (dds){
        s = "sdf"
        sk = 9
        eee= 74
        var d = sk/eee
    }else{
        var sd =dds
        println(sd)
        sd = false
        sd = false
        sd = true
    }
}